package com.kfm.am;

import java.util.Objects;

public class Person {

    private String name;
    private Integer age;
    private Character gender;
    private Boolean isMarried;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Character getGender() {
        return gender;
    }

    public void setGender(Character gender) {
        this.gender = gender;
    }

    public Boolean getMarried() {
        return isMarried;
    }

    public void setMarried(Boolean married) {
        isMarried = married;
    }

    public Person(){}

    public Person(String name, Integer age, Character gender, Boolean isMarried) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.isMarried = isMarried;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender=" + gender +
                ", isMarried=" + isMarried +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return Objects.equals(name, person.name) && Objects.equals(age, person.age) && Objects.equals(gender, person.gender) && Objects.equals(isMarried, person.isMarried);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, gender, isMarried);
    }
}
